# This dockerfile is specific to building Multus for OpenShift
FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS build
ENV __doozer=update BUILD_RELEASE=202202160023.p0.gbfcc6c8.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.gbfcc6c8.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=bfcc6c8 OS_GIT_VERSION=4.10.0-202202160023.p0.gbfcc6c8.assembly.stream-bfcc6c8 SOURCE_DATE_EPOCH=1632936828 SOURCE_GIT_COMMIT=bfcc6c85b5ad1c47fc1d50ddec0acd108d270fe1 SOURCE_GIT_TAG=bfcc6c8 SOURCE_GIT_URL=https://github.com/openshift/multus-networkpolicy 

# Add everything
ADD . /usr/src/multi-networkpolicy-iptables
WORKDIR /usr/src/multi-networkpolicy-iptables
RUN go build ./cmd/multi-networkpolicy-iptables/

FROM openshift/ose-base:v4.10.0.20220216.010142
ENV __doozer=update BUILD_RELEASE=202202160023.p0.gbfcc6c8.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202160023.p0.gbfcc6c8.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=bfcc6c8 OS_GIT_VERSION=4.10.0-202202160023.p0.gbfcc6c8.assembly.stream-bfcc6c8 SOURCE_DATE_EPOCH=1632936828 SOURCE_GIT_COMMIT=bfcc6c85b5ad1c47fc1d50ddec0acd108d270fe1 SOURCE_GIT_TAG=bfcc6c8 SOURCE_GIT_URL=https://github.com/openshift/multus-networkpolicy 
RUN dnf install -y iptables
COPY --from=build /usr/src/multi-networkpolicy-iptables/multi-networkpolicy-iptables /usr/bin
WORKDIR /usr/bin


ENTRYPOINT ["multi-networkpolicy-iptables"]

LABEL \
        io.k8s.display-name="Multus NetworkPolicy" \
        io.k8s.description="This is a component of OpenShift Container Platform and provides NetworkPolicy objects for secondary interfaces created with Multus CNI" \
        io.openshift.tags="openshift" \
        maintainer="Doug Smith <dosmith@redhat.com>" \
        name="openshift/ose-multus-networkpolicy" \
        com.redhat.component="ose-multus-networkpolicy-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        io.openshift.maintainer.subcomponent="multus" \
        release="202202160023.p0.gbfcc6c8.assembly.stream" \
        io.openshift.build.commit.id="bfcc6c85b5ad1c47fc1d50ddec0acd108d270fe1" \
        io.openshift.build.source-location="https://github.com/openshift/multus-networkpolicy" \
        io.openshift.build.commit.url="https://github.com/openshift/multus-networkpolicy/commit/bfcc6c85b5ad1c47fc1d50ddec0acd108d270fe1" \
        version="v4.10.0"

